package com.pkk.cloud.support.oauth2.config.integration.authenticator;

import com.pkk.cloud.support.oauth2.config.integration.IntegrationAuthentication;

/**
 * @description:
 * @author: peikunkun
 * @create: 2020-03-18 11:51
 **/
public interface IntegrationAuthenticator<T> {

  /**
   * 处理集成认证
   *
   * @param integrationAuthentication
   * @Return
   */
  T authenticate(IntegrationAuthentication integrationAuthentication);


  /**
   * 进行预处理
   *
   * @param integrationAuthentication
   */
  void prepare(IntegrationAuthentication integrationAuthentication);

  /**
   * 判断是否支持集成认证类型
   *
   * @param integrationAuthentication
   * @Return
   */
  boolean support(IntegrationAuthentication integrationAuthentication);

  /**
   * 认证结束后执行
   *
   * @param integrationAuthentication
   */
  void complete(IntegrationAuthentication integrationAuthentication);


}
